package com.fundcrawler.dto;

import lombok.Builder;
import lombok.Data;

@Builder
@Data
public class Response<T> {
    private String message;
    private String error;
    private String status;
    private T result;

    public static Response message(String message){
        return Response.builder()
                .status("success")
                .message(message)
                .build();
    }
//    public static <T> Response<T> success(T result){
//        return Response.builder()
//                .status("success")
//                .message("success")
//                .result(result)
//                .build();
//    }
    public static Response error(String error){
        return Response.builder()
                .status("error")
                .error(error)
                .build();
    }
}
